package com.aco.party.enums;

/**
 * Created by WangShijun on 2016/2/29.
 */
public enum UserStatusEnum {
    有效(1,"有效"),
    无效(-1,"无效"),
    NULL(0,"");

    private int value;
    private String desc;

    UserStatusEnum(int value, String desc){
        this.value = value;
        this.desc = desc;
    }

    public int getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }

    public static UserStatusEnum getUserStatus(Integer value){
        if(value == null) return NULL;
        for (UserStatusEnum type : UserStatusEnum.values()) {
            if(type.value == value)
                return type;
        }
        return NULL;
    }

}
